package com.doujia.pattern.factory.simple;

import java.util.List;
import java.util.Map;

/**
 * 简单工厂
 */
public class SimpleFactory {

    public static IBean getBean(int code){
        if(code == 1){
            return new BeanA();
        }else if( code == 2 ){
            return new BeanB();
        }

        return new BeanA();
    }

    public static void main(String[] args) {
        SimpleFactory.getBean(1).doService();

    }

}
